﻿using System;
using System.Collections.Generic;
using System.Data;
using Loki.Data;
using Luna.Data.Common;

namespace Luna.Data
{
   /// <summary>
    /// Generator for data interface IEntityData.
    /// </summary>
    public partial class Manager
    {
        public void Load(Luna.Data.Crm.IEntityData data)
        {   
                Load((IReferenceData)data);
                data.PK = Generator.GetGuid();
                data.Manager = Generator.GetString(100);
                data.Name = Generator.GetString(100);
                data.Company = Generator.GetString(100);
                data.Title = Generator.GetString(20);
                data.Phone = Generator.GetString(15);
                data.Mobile = Generator.GetString(15);
                data.Source = Generator.GetString(50);
                data.Url = Generator.GetString(50);
                data.Mail = Generator.GetString(30);
                data.Fax = Generator.GetString(15);
                data.Status = Generator.GetString(20);
                data.Skype = Generator.GetString(30);
                data.Twitter = Generator.GetString(50);
                data.Sector = Generator.GetString(50);
                data.NoMail = Generator.GetBoolean();
                data.Adress = Generator.GetString(200);
                data.ZipCode = Generator.GetString(10);
                data.City = Generator.GetString(50);
                data.Country = Generator.GetString(50);
                data.Description = Generator.GetString(500);
        }
        
        public bool AreSame(Luna.Data.Crm.IEntityData data1, Luna.Data.Crm.IEntityData data2)
        {
            bool buffer = true;
             buffer &= AreSame((IReferenceData)data1, (IReferenceData)data2);
            
            buffer &= data1.PK == data2.PK;
            buffer &= data1.Manager == data2.Manager;
            buffer &= data1.Name == data2.Name;
            buffer &= data1.Company == data2.Company;
            buffer &= data1.Title == data2.Title;
            buffer &= data1.Phone == data2.Phone;
            buffer &= data1.Mobile == data2.Mobile;
            buffer &= data1.Source == data2.Source;
            buffer &= data1.Url == data2.Url;
            buffer &= data1.Mail == data2.Mail;
            buffer &= data1.Fax == data2.Fax;
            buffer &= data1.Status == data2.Status;
            buffer &= data1.Skype == data2.Skype;
            buffer &= data1.Twitter == data2.Twitter;
            buffer &= data1.Sector == data2.Sector;
            buffer &= data1.NoMail == data2.NoMail;
            buffer &= data1.Adress == data2.Adress;
            buffer &= data1.ZipCode == data2.ZipCode;
            buffer &= data1.City == data2.City;
            buffer &= data1.Country == data2.Country;
            buffer &= data1.Description == data2.Description;
            return buffer;
        }
    }
}